<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Link</cContentSchemaName>
        <cContentXmlBrief>
          <Content internalLink="" externalLink="">
            <Name/>
            <Url type="external"/>
            <Images>
              <img class="thumbnail"/>
            </Images>
            <Category/>
            <Body/>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail/>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <StartDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind id="cContentLinkTitle" nodeset="tblContent/cContentName" required="true()" type="string"/>
    <bind id="dPublishDate" nodeset="tblContent/dPublishDate" required="false()" type="string"/>
    <bind id="dExpireDate" nodeset="tblContent/dExpireDate" required="false()" type="string"/>
    <bind nodeset="tblContent/cContentXmlBrief/Content">
      <bind id="cContentLinkTitle" nodeset="Name" required="true()" type="string"/>
      <bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
      <bind id="cContentURL" nodeset="Url" required="false()" type="string"/>
      <bind nodeset="Url">
        <bind id="cLinkType" nodeset="@type" required="false()" type="string"/>
        <bind id="cLinkTarget" nodeset="@target" required="false()" type="string"/>
      </bind>
      <bind id="cContentCategory" nodeset="Category" required="false()" type="string"/>
      <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
    </bind>
    <bind id="nStatus" nodeset="tblContent/nStatus" required="true()" type="string"/>
    <bind id="cDescription" nodeset="tblContent/cDescription" required="false()" type="string"/>
    <!--bind id="cContentRecRead" nodeset="tblContent/cContentXmlDetail/Content/group/div[@class='recRead']" required="false()" type="string"/-->
  </model>
  <group ref="EditContent" class="2col">
    <label>Edit Link</label>
    <group>
      <group class="Content">
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <label>Settings</label>
        <input bind="dPublishDate" class="calendar short">
          <label>Publish Date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire Date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="required vshort">
          <label>Status</label>
          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <input bind="cDescription" class="short">
          <label>Change Notes</label>
        </input>
      </group>
      <group class="Content">
        <label>Thumbnail</label>
        <input bind="cContentThumbnail" class="short pickImage">
        </input>
      </group>
    </group>
    <group>
      <group class="Content">
        <label>Link Details</label>
        <input bind="cContentLinkTitle" class="required short">
          <label>Link Title</label>
        </input>

        <select1 bind="cLinkType" appearance="full" class="required">
          <label>Type of Link</label>
          <item>
            <label>External (Going to another site)</label>
            <value>external</value>
            <toggle case="cLinkType_1" event="DOMActivate"/>
          </item>
          <item>
            <label>Internal (Going to a page on this site)</label>
            <value>internal</value>
            <toggle case="cLinkType_2" event="DOMActivate"/>
          </item>
        </select1>
        <switch class="disable">
          <case id="cLinkType_1">
            <input bind="cContentURL" class="short">
              <label>URL</label>
            </input>
            <select1 bind="cLinkTarget" appearance="full" class="required">
              <label>Target</label>
              <item>
                <label>New Window</label>
                <value>New Window</value>
              </item>
              <item>
                <label>Same Window</label>
                <value>Same Window</value>
              </item>
            </select1>
          </case>
          <case id="cLinkType_2">
            <select1 bind="cContentURL" class="siteTree">
              <label>Page</label>
            </select1>
          </case>
        </switch>
      </group>
      <group ref="Content" class="Content">
        <label>Link Accompanying Text</label>
        <textarea bind="cContentBody" class="TextArea xhtml" rows="19" cols="60">
        </textarea>
      </group>
      <group>
        <label>Categories</label>
        <!--<input bind="cContentCategory" class="short">
          <label>Category</label>
        </input>-->
        <relatedContent search="find add" type="Tag" relationType="Tag" direction="2way">
          <label>Related</label>
        </relatedContent>
      </group>
    </group>
  </group>
  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Link</label>
    </submit>
  </group>
</Content>
